package com.daogu.fuelcard.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;

import java.math.BigDecimal;

@Schema(title = "油卡实体类")
public class OilCard {

    @Schema(description = "主键id")
    private Integer id;

    @Schema(description = "卡号")
    @NotBlank(message = "卡号不能为空")
    @Size(min = 7,max = 10,message = "卡号长度为7-10")
    private String cardNo;

    @Schema(description = "余额")
    private BigDecimal balance;

    public OilCard() {}

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCardNo() {
        return cardNo;
    }

    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }

    public BigDecimal getBalance() {
        return balance;
    }

    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    @Override
    public String toString() {
        return "OilCard{" +
                "id=" + id +
                ", cardNo='" + cardNo + '\'' +
                ", balance=" + balance +
                '}';
    }
}
